﻿Public Class InvertBooleanConverter
    Implements IValueConverter

    Public Function Convert(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.Convert
        Try
            Return Not DirectCast(value, Boolean)
        Catch ex As Exception
            Return False
        End Try
    End Function

    Public Function ConvertBack(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.ConvertBack
        Try
            Return Not DirectCast(value, Boolean)
        Catch ex As Exception
            Return True
        End Try
    End Function
End Class
